package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaUmpires extends javax.swing.JFrame {
	private JPanel panUmpires;
	private JTextField txtNombre;
	private JButton btnCancelar;
	private JLabel lblTituloUmpire;
	private JButton btnRegistrar;
	private JTextField txtFechaNac;
	private JTextField txtApellido;
	private JTextField txtCedula;
	private JLabel lblFechaNac;
	private JLabel lblApellido;
	private JLabel lblNombre;
	private JLabel lblCedula;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public VentanaUmpires() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				panUmpires = new JPanel();
				getContentPane().add(panUmpires, BorderLayout.CENTER);
				panUmpires.setLayout(null);
				panUmpires.setBackground(new java.awt.Color(255,255,255));
				{
					lblCedula = new JLabel();
					panUmpires.add(lblCedula);
					lblCedula.setText("Cedula:");
					lblCedula.setBounds(90, 88, 50, 15);
				}
				{
					lblNombre = new JLabel();
					panUmpires.add(lblNombre);
					lblNombre.setText("Nombre:");
					lblNombre.setBounds(87, 122, 53, 15);
				}
				{
					lblApellido = new JLabel();
					panUmpires.add(lblApellido);
					lblApellido.setText("Apellido:");
					lblApellido.setBounds(87, 157, 70, 15);
				}
				{
					lblFechaNac = new JLabel();
					panUmpires.add(lblFechaNac);
					lblFechaNac.setText("Fecha de Nacimiento:");
					lblFechaNac.setBounds(48, 191, 136, 15);
				}
				{
					txtCedula = new JTextField();
					panUmpires.add(txtCedula);
					txtCedula.setBounds(210, 85, 94, 22);
				}
				{
					txtNombre = new JTextField();
					panUmpires.add(txtNombre);
					txtNombre.setBounds(210, 119, 98, 22);
				}
				{
					txtApellido = new JTextField();
					panUmpires.add(txtApellido);
					txtApellido.setBounds(210, 154, 98, 22);
				}
				{
					txtFechaNac = new JTextField();
					panUmpires.add(txtFechaNac);
					txtFechaNac.setBounds(210, 188, 98, 22);
				}
				{
					btnRegistrar = new JButton();
					panUmpires.add(btnRegistrar);
					btnRegistrar.setText("Registrar");
					btnRegistrar.setBounds(87, 228, 90, 22);
					btnRegistrar.setBackground(new java.awt.Color(173,216,230));
				}
				{
					btnCancelar = new JButton();
					panUmpires.add(btnCancelar);
					btnCancelar.setText("Cancelar");
					btnCancelar.setBounds(210, 228, 90, 22);
					btnCancelar.setBackground(new java.awt.Color(173,216,230));
				}
				{
					lblTituloUmpire = new JLabel();
					panUmpires.add(lblTituloUmpire);
					lblTituloUmpire.setText("Registro de Umpire");
					lblTituloUmpire.setBounds(103, 30, 226, 15);
					lblTituloUmpire.setFont(new java.awt.Font("DialogInput",1,16));
					lblTituloUmpire.setForeground(new java.awt.Color(30,144,255));
				}
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public void agregarListener(ActionListener accion){
		btnRegistrar.addActionListener(accion);
		btnCancelar.addActionListener(accion);
	}
	
	public void mostrarMensaje(String mensaje){
		JOptionPane.showMessageDialog(this, mensaje);
	}
	
	public String getCedula(){
		return txtCedula.getText();		
	}
	
	public String getNombre(){
		return txtNombre.getText();
	}
	
	public String getApellido(){
		return txtApellido.getText();
	}
	
	public String getFechaNac(){
		return txtFechaNac.getText();
	}
	
	public void blanquearCampos(){
		txtCedula.setText("");
		txtNombre.setText("");
		txtApellido.setText("");
		txtFechaNac.setText("");
	}

}
